#!/bin/bash -e

# Date 		: 2021.1.25
# Author	: majin
# Mail 		: xx
# Function	: set gcc path in term, just temp 
# Version 	: 1.0
# Update 	: 2021.1.25

usr_dir="/home"
GCC_PATH="${usr_dir}/majin/install/gcc_install/bin/hcc"
# GCC_PATH="${usr_dir}/majin/install/gcc_install/bin/gcc-9.3.0"

# usr_dir="/data-HDD"
# GCC_PATH="${usr_dir}/linda/gcc-9.3.0/build/install"

get_now_gcc_path=`dirname $(which gcc)`
if [[ "${get_now_gcc_path}" != "${GCC_PATH}/bin" ]];then
    export PATH=${GCC_PATH}/bin:$PATH
    export CC=${GCC_PATH}/bin/gcc
    export CXX=${GCC_PATH}/bin/g++
    export LD_LIBRARY_PATH=${GCC_PATH}/lib64:${LD_LIBRARY_PATH}
else
    echo "the path ${get_now_gcc_path} has been set, just skip"
fi

# add bolt
BOLT_PATH="${usr_dir}/majin/install/tools/bolt/install"
export PATH=${BOLT_PATH}/bin:$PATH

# add bolt
SSHPASS_PATH="${usr_dir}/majin/install/tools/sshpass-1.08"
export PATH=${SSHPASS_PATH}:$PATH

majin-help(){
    echo "usr_dir: ${usr_dir}"
    echo "source ${usr_dir}/majin/set_env.s"
    echo "perf record -e cycles:u -j any,u -o perf.data"
    echo "ps -ef | grep mysql"
}
